//
// Created by lqk on 2022/1/30.
//

#ifndef QUADCEREBELLUM_PERIODICFUNCTIONTASK_H
#define QUADCEREBELLUM_PERIODICFUNCTIONTASK_H
#include "PeriodicTask.h"

class PeriodicFunctionTask : public PeriodicTask{
public:
    PeriodicFunctionTask(PeriodicTaskManager* taskManager,const float& period,const std::string& name,void (*function)()):PeriodicTask(taskManager,period,name),m_function(function){}
    void Init(){}
    void RunOnce(){m_function();}
    ~PeriodicFunctionTask(){Stop();}

private:
    void(*m_function)();
    void CleanUp(){}

};


#endif //QUADCEREBELLUM_PERIODICFUNCTIONTASK_H
